﻿<UserControl x:Class="CredentialsManager.Views.CreateRoleView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Height="300" Width="200">
    <Grid Style="{StaticResource DisableIfLoadingStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Margin="10">
            <Label>Role name:</Label>
            <TextBox Text="{Binding Role, UpdateSourceTrigger=PropertyChanged}" />
            <WrapPanel>
                <Button 
                    Content="Create" 
                    Command="{Binding CreateCommand}" 
                    Margin="0, 10, 0, 10" 
                    Padding="10, 5, 10, 5" 
                    IsDefault="True" 
                    IsEnabled="{Binding IsValid}" />
                <Button 
                    Content="Close" 
                    Command="{Binding CloseCommand}" 
                    Margin="10" 
                    Padding="10, 5, 10, 5" 
                    IsCancel="True"  />
            </WrapPanel>
        </StackPanel>
        <ListView Grid.Row="1" ItemsSource="{Binding NewRoles}" Margin="10" />
    </Grid>
</UserControl>
